#!/bin/sh

PATH=/bin:/sbin:/usr/bin:/usr/sbin; export PATH

# ------------------------------------------------------------
# relaunch karabiner_grabber

killall karabiner_grabber
killall karabiner_console_user_server

# If plistFilePath is already bootstrapped and disabled, launchctl bootstrap will fail until it is enabled again.
# So we should enable it first, and then bootstrap and enable it.
launchctl enable system/org.pqrs.karabiner.karabiner_grabber
launchctl bootstrap system /Library/LaunchDaemons/org.pqrs.karabiner.karabiner_grabber.plist
launchctl enable system/org.pqrs.karabiner.karabiner_grabber

exit 0
